import service from '../internal/service.js'

// 活跃度页面==========================
/**
 * 活跃度环比
 * @param {Object: shop} 店铺id
 * @param {Object: date} 日期 (默认值：当前日期)
 */
export function APIGetlivenessCompareData ({ shop, date = '' }) {
  return service({
    url: `api/shops/${shop}/liveness-compare/?date=${date}`,
    method: 'get'
  })
}

/**
 * 活跃度列表
 * @param {Object: shop} 店铺id
 * @param {Object: date} 日期 (默认值：当前日期)
 */
export function APIGetLivenessListData ({ shop, startDate, endDate }) {
  return service({
    url: `api/shops/${shop}/daily-range-liveness/?start_date=${startDate}&end_date=${endDate}`,
    method: 'get'
  })
}

// 活跃天数页面==========================

// 活跃天数列表 周
export function APIGetWeekOfLivenessData ({ shop, startDate, endDate }) {
  return service({
    url: `api/shops/${shop}/liveness-week/?start_date=${startDate}&end_date=${endDate}`,
    method: 'get'
  })
}

/**
 * [APIGetWeekOfLivenessData description]   跃天数列表 月
 * @param       {[type]} shop      [description]
 * @param       {[type]} startDate [description]
 * @param       {[type]} endDate   [description]
 * @constructor
 */
export function APIGetMonthOfLivenessData ({ shop, startDate, endDate }) {
  return service({
    url: `api/shops/${shop}/liveness-month/?start_date=${startDate}&end_date=${endDate}`,
    method: 'get'
  })
}
